//
//  Modelcontent.m
//  HYHOME
//
//  Created by Mac on 16/1/22.
//  Copyright © 2016年 Mac. All rights reserved.
//

#import "Modelcontent.h"

@implementation Modelcontent

//归档时自动调用
- (void)encodeWithCoder:(NSCoder *)aCoder {
    //将需要保存的属性进行编码
    [aCoder encodeObject:self.content_url forKey:@"content_url"];
    [aCoder encodeObject:self.cover_image_url forKey:@"cover_image_url"];
    [aCoder encodeObject:self.title forKey:@"title"];
    [aCoder encodeObject:self.ida forKey:@"id"];
    [aCoder encodeObject:self.share_msg forKey:@"share_msg"];
    [aCoder encodeObject:self.liked forKey:@"liked"];
    [aCoder encodeObject:self.likes_count forKey:@"likes_count"];
}

//反归档时自动调用
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [self init];
    if (self) {
        self.content_url = [aDecoder decodeObjectForKey:@"content_url"];
        self.cover_image_url = [aDecoder decodeObjectForKey:@"cover_image_url"];
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.ida = [aDecoder decodeObjectForKey:@"id"];
        self.share_msg = [aDecoder decodeObjectForKey:@"share_msg"];
        self.liked = [aDecoder decodeObjectForKey:@"liked"];
        self.likes_count = [aDecoder decodeObjectForKey:@"likes_count"];
    }
    return self;
}


@end
